import request from "@/utils/request";

interface pageConf {
  num: string | number;
  page: string | number;
}
// 查询小区信息
export const getCommunities = (params: pageConf) =>
  request.get(`/community/?page=${params.page}&num=${params.num}`);

// 创建小区信息
export const createCommunity = (data: any) => request.post("/community/", data);

// 修改小区信息
export const updateCommunity = (data: any) => request.put("/community/", data);

// 删除小区信息
export const deleteCommunities = (data: any) =>
  request.delete("/community/", { data: data });

// 获取上传token
export const getUploadInfo = (data: any) =>
  request.post("/admin/tcb_token", data);

// 上传文件
export const uploadFile = (data: any) => request.post(data.url, data.data);

// 下载图片
export const downFile = (data: any) =>
  request.post("/admin/tcb_download", data);
